import { defineStore } from 'pinia'
import Cartapi, { type cartListData } from '@/api/shopcart'

interface cartstoreData {
  CartList: cartListData[]
}
export const shopCartStore = defineStore('cart', {
  state(): cartstoreData {
    return {
      CartList: [],
    }
  },
  actions: {
    async setCartList() {
      try {
        const reslut = await Cartapi.cartList()
        this.CartList = reslut.data
      } catch (error) {
      }
    }
  },
  getters: {
  }
})
